// pages/searchResult/searchResult.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    value:"",
    show:false,
    sliderValue: [0, 5000],
    campItemList:[
      {
        img:"https://img.yzcdn.cn/vant/cat.jpeg",
        name:"hflkasjdkfjasdklfj",
        type:["露营1","露营2"],
        distance:"100km"
      },
      {
        img:"https://img.yzcdn.cn/vant/cat.jpeg",
        name:"hflkasjdkfjasdklfj",
        type:["露营2","露营3"],
        distance:"300km"
      },
      {
        img:"https://img.yzcdn.cn/vant/cat.jpeg",
        name:"hflkasjdkfjasdklfj",
        type:["露营2","露营3"],
        distance:"300km"
      },
      {
        img:"https://img.yzcdn.cn/vant/cat.jpeg",
        name:"hflkasjdkfjasdklfj",
        type:["露营2","露营3"],
        distance:"300km"
      }
    ]
  },
  onSliderChanging(e) {
    const newValue = e.detail;
    this.setData({
      sliderValue: newValue,
    });
    console.log(this.data.sliderValue,"滑动的值")
  },

  //回车搜索时触发
  onSearch() {

  },
  //点击筛选按钮触发
  showPopup() {
    this.setData({ show: true });
  },
  // 关闭筛选弹窗
  closePopup() {
    this.setData({ show: false });
  },
  //重置筛选
  resetSelect(){
    this.setData({
      sliderValue:[0,5000]
    })
  },
  //确定筛选
  confirmSelect(){
    const obj = {
      ...this.data
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    console.log(options,"搜索页面传递过来的数据")
    this.setData({
      value:options.name
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})